package 算法.leetcode;

/**
 * @author:谢君臣
 * @Date:2021/5/19-16:01
 * @version:1.0
 * @function:
 */
public class lc461 {
    public int hammingDistance(int x, int y) {
        int count =0;
        int temp = x^y;
        for (int i = 0; i < 32; i++) {
            if (temp==0)return count;
            if ((temp>>i&1)==1) count++;
        }
        return count;
    }
}
